require "config"
local controller = require "controller.admin"
local function pr() 
        print("Fdasfasd")
end

local function do_action(method, ...)
    local args = {...} or {}
    method(unpack(args))
end


local uri = ngx.var.uri
local regex = '\\/openresty_waf\\/admin\\/(\\w+)'
local m, err = ngx.re.match(uri,regex, "jo")

if m then
    -- config import
    local fields= {logout=controller.logout, login=controller.login, index=controller.index}
    local view_method = fields[m[1]]
    do_action(view_method, in_html_template_dir)
else
    return 
end
